package view;

/**
 * factory for different draw graph classes that can visualize stock information
 * 
 * @author difan
 * 
 */

public class DrawFactory {
    private static GraphDrawer ourDrawGraph;

    /**
     * Draw line graph by default.
     */
    public DrawFactory () {
        ourDrawGraph = new LineGraphDrawer();
    }

    /**
     * return an subclass of draw graph for view
     */
    public GraphDrawer getDrawGraph () {
        return ourDrawGraph;
    }

    /**
     * Specify which subclass of draw graph to use for the view.
     * 
     * @param n identify specific draw graph
     */
    public static void setGraphStyle (Integer n) {
        switch (n) {
            case 1:
                ourDrawGraph = new LineGraphDrawer();
                break;
            default:
                break;
        }

    }

}
